/********************************************************************
*****      Pennsylvania Dispensary Application Analysis Clean  ****** 
*****             Lee Hannah - lee.hannah@wright.edu           ******	
*****							2.18.2022					   ******	
********************************************************************/


use "/Users/leehannah/OneDrive - The Pennsylvania State University/MJ and Social Equity/APSA 2021/PAR Submission/Final Copy/PA Dispensary License Data.dta"



/***********************************************************************************
*****					GENERATE DEPENDENT VARIABLES						   *****
***********************************************************************************/

gen license1 = .

replace license1 = 0 if phase == 1 & licensed == 0
replace license1 = 1 if phase == 1 & licensed == 1

label var license1 "Phase I License Awarded"


gen license2 = .

replace license2 = 0 if phase == 2 & licensed == 0
replace license2 = 1 if phase == 2 & licensed == 1

label var license2 "Phase II License Awarded"

/***********************************************************************************
Table 3. PA Dept. of Health Medical Marijuana Dispensary Application Scorecard -  **
Average Scores in Each Category 												  **
***********************************************************************************/

************************
***** 	PHASE 1 	****
************************

summarize if phase == 1
/*

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |        251           1           0          1          1
dispensary~r |          0
        name |          0
diversityp~n |        251    41.43825    15.27269          5         75
operationa~e |        251    50.63677    16.08474          7       87.6
-------------+---------------------------------------------------------
qualificat~s |        251    30.49797    6.671495        8.2         45
    security |        251    57.61633    13.32091        9.4         79
transporta~n |        251    15.44024    3.646644        3.6      23.83
     storage |        251    28.20474    7.436852          5       39.8
    labeling |        251    15.01586    3.842404        2.2      21.33
-------------+---------------------------------------------------------
   inventory |        251    29.71873    7.301795          4       40.6
   diversion |        251     29.4659    7.571075        4.4       42.2
  sanitation |        251    29.05665    7.487633          5         41
recordkeep~g |        251    16.25199    3.808481        3.6         27
     history |        251    50.48633    13.06682        9.6         67
-------------+---------------------------------------------------------
     capital |        251    53.47669    12.23278       10.2       72.6
   community |        251    43.61355    12.57227          3       67.5
    siteplan |        251    26.73339    8.932119          0       41.8
  personalid |        251    33.14884    6.450017          7         43
     awarded |        251    550.8265     120.491      132.6      771.5
-------------+---------------------------------------------------------
    licensed |        251    .1035857    .3053311          0          1
dispensaries |         27    1.962963    .8979242          1          3

*/

summarize if phase == 1 & licensed == 1

/*

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |         27           1           0          1          1
dispensary~r |          0
        name |          0
diversityp~n |         27     50.7037    12.17442         30         75
operationa~e |         27    63.97778    10.70934       45.4       87.6
-------------+---------------------------------------------------------
qualificat~s |         27        35.7    3.208915       29.8         42
    security |         27    68.00852    4.284131       58.6         79
transporta~n |         27    18.25667    1.203862      15.17         20
     storage |         27    34.37667    2.801933       28.8       39.8
    labeling |         27     17.8963    2.034822       13.5      21.33
-------------+---------------------------------------------------------
   inventory |         27    35.15407    3.095967       27.6       40.2
   diversion |         27    35.26889    3.252167         30       42.2
  sanitation |         27    34.74667    3.198548         29         41
recordkeep~g |         27    18.88667    1.110727       16.8       20.6
     history |         27    61.18963    3.205886         53         67
-------------+---------------------------------------------------------
     capital |         27    62.59296    4.955124      52.17       72.6
   community |         27    51.42593    9.308499         34       67.5
    siteplan |         27     34.9863    4.018741      22.33       41.4
  personalid |         27    38.21111    2.215052       32.8         43
     awarded |         27    661.3822    37.27945      594.1      771.5
-------------+---------------------------------------------------------
    licensed |         27           1           0          1          1
dispensaries |         27    1.962963    .8979242          1          3
    license1 |         27           1           0          1          1
    license2 |          0



*/

summarize if phase == 1 & licensed == 0
/*

   Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |        224           1           0          1          1
dispensary~r |          0
        name |          0
diversityp~n |        224    40.32143    15.25021          5         75
operationa~e |        224    49.02871    15.89103          7       85.6
-------------+---------------------------------------------------------
qualificat~s |        224    29.87094     6.71013        8.2         45
    security |        224    56.36371     13.4959        9.4       76.5
transporta~n |        224    15.10076    3.696341        3.6      23.83
     storage |        224     27.4608    7.477949          5       39.8
    labeling |        224    14.66866     3.86565        2.2       20.6
-------------+---------------------------------------------------------
   inventory |        224    29.06357    7.392286          4       40.6
   diversion |        224    28.76643    7.645888        4.4       42.2
  sanitation |        224     28.3708    7.567525          5         41
recordkeep~g |        224    15.93442    3.895521        3.6         27
     history |        224    49.19621    13.21642        9.6         67
-------------+---------------------------------------------------------
     capital |        224    52.37786     12.3944       10.2       72.6
   community |        224    42.67188    12.60225          3       65.5
    siteplan |        224    25.73862    8.849801          0       41.8
  personalid |        224    32.53866    6.526179          7      42.33
     awarded |        224    537.5006    120.2315      132.6      760.3
-------------+---------------------------------------------------------
    licensed |        224           0           0          0          0
dispensaries |          0
    license1 |        224           0           0          0          0
    license2 |          0


*/

************************
***** 	PHASE 2 	****
************************


summarize if phase == 2
/*
    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |        136           2           0          2          2
dispensary~r |          0
        name |          0
diversityp~n |        136    51.33824    13.34623         25         75
operationa~e |        136    58.40993    12.74892         22       80.5
-------------+---------------------------------------------------------
qualificat~s |        136    31.23529    4.865674         10      40.75
    security |        136    62.07904     8.40005      23.75      76.75
transporta~n |        136     30.5625    5.069859         10      40.75
     storage |        136    48.19118    7.312359       27.5         60
    labeling |          0
-------------+---------------------------------------------------------
   inventory |        136    49.69669    7.348999      23.75         61
   diversion |        136    63.63787    8.993095      23.75      78.25
  sanitation |        136    32.06434    6.330628       8.75       41.5
recordkeep~g |        136    51.50919    7.448925         20      64.25
     history |        136    54.96507    8.720143      21.25      69.75
-------------+---------------------------------------------------------
     capital |          0
   community |        136    60.44118    20.32796         17         95
    siteplan |        136    28.04779    7.094437      11.25         42
  personalid |          0
     awarded |        136    622.1783    79.35404     309.25     749.25
-------------+---------------------------------------------------------
    licensed |        136    .1691176    .3762416          0          1
dispensaries |         23    1.173913    .3875534          1          2

*/

summarize if phase == 2 & licensed == 1

/*

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |         23           2           0          2          2
dispensary~r |          0
        name |          0
diversityp~n |         23    58.52174    11.38128         35         74
operationa~e |         23    68.26087    6.967652      50.25      78.25
-------------+---------------------------------------------------------
qualificat~s |         23       33.75    3.303751         28         39
    security |         23    69.41304    4.098648      61.25      76.25
transporta~n |         23    35.26087    2.827903         29      40.75
     storage |         23    54.95652    4.177627         43         60
    labeling |          0
-------------+---------------------------------------------------------
   inventory |         23    55.47826    3.414469      49.75         61
   diversion |         23    71.32609    4.835025      61.75      78.25
  sanitation |         23          36    2.837452      30.25       41.5
recordkeep~g |         23    56.01087    3.425737      49.25      64.25
     history |         23    61.83696    3.604455         52      69.75
-------------+---------------------------------------------------------
     capital |          0
   community |         23    75.08696    18.74933         45         95
    siteplan |         23    32.32609    5.778799       17.5         42
  personalid |          0
     awarded |         23    708.2283    28.09085        651     749.25
-------------+---------------------------------------------------------
    licensed |         23           1           0          1          1
dispensaries |         23    1.173913    .3875534          1          2

*/

summarize if phase == 2 & licensed == 0

/*

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       phase |        113           2           0          2          2
dispensary~r |          0
        name |          0
diversityp~n |        113    49.87611    13.28542         25         75
operationa~e |        113    56.40487    12.74332         22       80.5
-------------+---------------------------------------------------------
qualificat~s |        113    30.72345    4.982935         10      40.75
    security |        113    60.58628    8.273895      23.75      76.75
transporta~n |        113    29.60619    4.894399         10      36.75
     storage |        113    46.81416    7.050581       27.5         60
    labeling |          0
-------------+---------------------------------------------------------
   inventory |        113    48.51991    7.385596      23.75         61
   diversion |        113    62.07301    8.847775      23.75      77.75
  sanitation |        113    31.26327    6.549591       8.75      41.25
recordkeep~g |        113    50.59292    7.717978         20       60.5
     history |        113    53.56637    8.799605      21.25       68.5
-------------+---------------------------------------------------------
     capital |          0
   community |        113    57.46018     19.3912         17         95
    siteplan |        113    27.17699    7.041545      11.25      40.25
  personalid |          0
     awarded |        113    604.6637    74.86737     309.25     728.25
-------------+---------------------------------------------------------
    licensed |        113           0           0          0          0
dispensaries |          0


*/

/***********************************************************************************
Table 4 Bivariate Logistic Regressions Predicting Odds of Being Awarded a 		  **
Dispensary License (Phases 1 and 2)												  **
***********************************************************************************/

************************
***** 	PHASE 1 	****
************************

logit license1 diversityplan, or

logit license1 operationaltimetable, or

logit license1 qualifications, or

logit license1 security, or

logit license1 transportation, or

logit license1 storage, or

logit license1 labeling, or

logit license1 inventory, or

logit license1 diversion, or

logit license1 sanitation, or

logit license1 recordkeeping, or

logit license1 history, or

logit license1 capital, or

logit license1 community, or

logit license1 siteplan, or

logit license1 personalid, or

************************
***** 	PHASE 2 	****
************************

logit license2 diversityplan, or

logit license2 operationaltimetable, or

logit license2 qualifications, or

logit license2 security, or

logit license2 transportation, or

logit license2 storage, or

logit license2 inventory, or

logit license2 diversion, or

logit license2 sanitation, or

logit license2 recordkeeping, or

logit license2 history, or

logit license2 community, or

logit license2 siteplan, or


/***********************************************************************************
*****					SETTING UP LOGISTIC REGRESSION ANALYSIS				  ******
***********************************************************************************/

/*************************
*** Collapsing indices ***
*************************/

gen ph1_partd = operationaltimetable + qualifications + security + transportation + storage + labeling + inventory + diversion + sanitation + recordkeeping if phase == 1

gen ph1_parte = history + capital if phase == 1

gen ph2_partd = operationaltimetable + qualifications + security + transportation + storage + inventory + diversion  + sanitation + recordkeeping if phase == 2

gen ph2_parte = history if phase == 2

label var ph1_partd "Part D: Plan of Operation"

label var ph2_partd "Part D: Plan of Operation"

label var ph1_parte "Part E: Organizational Capacity"

label var ph2_parte "Part E: Organizational Capacity"



/************************************************************************************************************
****         Figure 2. Distribution of Scores for Pennsylvania Dispensary Applications (Phase 1)		 ****
************************************************************************************************************/

twoway (histogram diversityplan if license1 == 0, start(-0) xlabel(0(20)100) width(5) freq color(gray) scheme(plotplain))  ///
	   (histogram diversityplan if license1 == 1, start(-0) xlabel(0(20)100) width(5) freq color(blue) saving("ph1diversityplan")), ///
	   legend(off)
	   
twoway (histogram ph1_partd if license1 == 0, start(-0) xlabel(0(50)550) width(10) freq color(gray) scheme(plotplain))  ///
	   (histogram ph1_partd if license1 == 1, start(-0) freq width(10) color(blue) saving("ph1partd")), ///
	   legend(off)
	   
twoway (histogram ph1_parte if license1 == 0, start(-0) xlabel(0(25)150) width(5) freq color(gray) scheme(plotplain))  ///
	   (histogram ph1_parte if license1 == 1, start(-0) width(5) freq color(blue) saving("ph1parte")), ///
	   legend(off)

twoway (histogram community if license1 == 0, start(-0) xlabel(0(20)100) width(5) freq color(gray) scheme(plotplain))  ///
	   (histogram community if license1 == 1, start(-0) width(5) freq color(blue) saving("ph1communityplan")), ///
	   legend(off)

twoway (histogram siteplan if license1 == 0, start(-0) xlabel(0(10)50) width(2.5) freq color(gray) scheme(plotplain))  ///
	   (histogram siteplan if license1 == 1, start(-0) width(2.5) freq color(blue) saving("ph1siteplan")), ///
	   legend(order (1 "Not Awarded License" 2 "Awarded License") pos(3))
	   

gr combine ph1diversityplan.gph ph1partd.gph ph1parte.gph ph1communityplan.gph ph1siteplan.gph, col(2) scheme(plotplain)


/************************************************************************************************************
****         Figure 3. Distribution of Scores for Pennsylvania Dispensary Applications (Phase 2)		 ****
************************************************************************************************************/


twoway (histogram diversityplan if license2 == 0, start(-0) xlabel(0(20)100) width(5) freq color(gray) scheme(plotplain))  ///
	   (histogram diversityplan if license2 == 1, start(-0) xlabel(0(20)100) width(5) freq color(red) saving("ph2diversityplan")), ///
	   legend(off)
	   
twoway (histogram ph2_partd if license2 == 0, start(-0) xlabel(0(75)675) width(15) freq color(gray) scheme(plotplain))  ///
	   (histogram ph2_partd if license2 == 1, start(-0) freq width(15) color(red) saving("ph2partd")), ///
	   legend(off)
	  
twoway (histogram ph2_parte if license2 == 0, start(-0) xlabel(0(15)75) width(2.5) freq color(gray) scheme(plotplain))  ///
	   (histogram ph2_parte if license2 == 1, start(-0) width(2.5) freq color(red) saving("ph2parte")), ///
	   legend(off)
	   
twoway (histogram community if license2 == 0, start(-0) xlabel(0(20)100) width(5) freq color(gray) scheme(plotplain))  ///
	   (histogram community if license2 == 1, start(-0) width(5) freq color(red) saving("ph2communityplan")), ///
	   legend(off)

twoway (histogram siteplan if license2 == 0, start(-0) xlabel(0(10)50) width(2.5) freq color(gray) scheme(plotplain))  ///
	   (histogram siteplan if license2 == 1, start(-0) width(2.5) freq color(red) saving("ph2siteplan")), ///
	   legend(order (1 "Not Awarded License" 2 "Awarded License") pos(3))
	   

gr combine ph2diversityplan.gph ph2partd.gph ph2parte.gph ph2communityplan.gph ph2siteplan.gph, col(2) scheme(plotplain)


/***********************************************************************************
*****					LOGISTIC REGRESSION ANALYSIS						   *****
*****	TABLE 5. Multivariate logistic regressions predicting odds of being    *****
*****			awarded a dispensary license (phases I and II)	  			   *****	
***********************************************************************************/

/******************************************************
****      Table 5 Column 1 - PHASE 1 FULL MODEL    ****
*******************************************************/

logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

/*
Iteration 0:   log likelihood = -85.692377  
Iteration 1:   log likelihood = -68.532993  
Iteration 2:   log likelihood = -59.827329  
Iteration 3:   log likelihood =   -58.7645  
Iteration 4:   log likelihood =  -58.73298  
Iteration 5:   log likelihood = -58.732906  
Iteration 6:   log likelihood = -58.732906  

Logistic regression                             Number of obs     =        251
                                                LR chi2(5)        =      53.92
                                                Prob > chi2       =     0.0000
Log likelihood = -58.732906                     Pseudo R2         =     0.3146

-------------------------------------------------------------------------------
     license1 | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
diversityplan |   1.017544   .0193583     0.91   0.361     .9803012    1.056202
    ph1_partd |   1.023903   .0115201     2.10   0.036     1.001571    1.046732
    ph1_parte |   1.045752   .0351519     1.33   0.183     .9790761    1.116969
    community |   .9890004   .0277875    -0.39   0.694     .9360102     1.04499
     siteplan |   1.136886   .0592167     2.46   0.014     1.026551     1.25908
        _cons |   2.51e-09   1.11e-08    -4.46   0.000     4.20e-13     .000015
-------------------------------------------------------------------------------
Note: _cons estimates baseline odds.

*/


*** Appendix Analysis

net describe collin, from(https://stats.idre.ucla.edu/stat/stata/ado/analysis)

collin diversityplan ph1_partd ph1_parte community siteplan if phase == 1

/*

  Collinearity Diagnostics

                        SQRT                   R-
  Variable      VIF     VIF    Tolerance    Squared
----------------------------------------------------
diversityplan      1.46    1.21    0.6854      0.3146
 ph1_partd      6.81    2.61    0.1468      0.8532
 ph1_parte      5.44    2.33    0.1837      0.8163
 community      1.97    1.40    0.5074      0.4926
  siteplan      2.03    1.42    0.4929      0.5071
----------------------------------------------------
  Mean VIF      3.54

                           Cond
        Eigenval          Index
---------------------------------
    1     5.8034          1.0000
    2     0.0847          8.2758
    3     0.0509         10.6766
    4     0.0394         12.1379
    5     0.0167         18.6168
    6     0.0048         34.7806
---------------------------------
 Condition Number        34.7806 
 Eigenvalues & Cond Index computed from scaled raw sscp (w/ intercept)
 Det(correlation matrix)    0.0345
*/


/***********************************
****     Table 5 Column 2 PHASE 2 FULL MODEL    ****
************************************/

logit license2 diversityplan ph2_partd history community siteplan, or

/*

Iteration 0:   log likelihood = -61.809874  
Iteration 1:   log likelihood = -42.171613  
Iteration 2:   log likelihood = -30.558686  
Iteration 3:   log likelihood = -30.117978  
Iteration 4:   log likelihood = -30.112961  
Iteration 5:   log likelihood = -30.112958  

Logistic regression                             Number of obs     =        136
                                                LR chi2(5)        =      63.39
                                                Prob > chi2       =     0.0000
Log likelihood = -30.112958                     Pseudo R2         =     0.5128

-------------------------------------------------------------------------------
     license2 | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
diversityplan |   1.089824    .040203     2.33   0.020     1.013809    1.171539
    ph2_partd |   1.060515   .0162969     3.82   0.000      1.02905    1.092943
      history |   1.054093   .0857342     0.65   0.517     .8987665    1.236264
    community |   1.056282   .0206623     2.80   0.005     1.016551    1.097565
     siteplan |   .9991632   .0582115    -0.01   0.989     .8913437    1.120025
        _cons |   3.42e-18   3.01e-17    -4.57   0.000     1.11e-25    1.05e-10
-------------------------------------------------------------------------------
Note: _cons estimates baseline odds.
Note: 2 failures and 0 successes completely determined.

*/

collin diversityplan ph2_partd history community siteplan if phase == 2

/*
  Collinearity Diagnostics

                        SQRT                   R-
  Variable      VIF     VIF    Tolerance    Squared
----------------------------------------------------
diversityplan      1.23    1.11    0.8104      0.1896
 ph2_partd      3.09    1.76    0.3237      0.6763
   history      2.80    1.67    0.3575      0.6425
 community      1.08    1.04    0.9260      0.0740
  siteplan      1.46    1.21    0.6872      0.3128
----------------------------------------------------
  Mean VIF      1.93

                           Cond
        Eigenval          Index
---------------------------------
    1     5.8250          1.0000
    2     0.0832          8.3675
    3     0.0439         11.5199
    4     0.0320         13.4951
    5     0.0123         21.7247
    6     0.0036         40.3862
---------------------------------
 Condition Number        40.3862 
 Eigenvalues & Cond Index computed from scaled raw sscp (w/ intercept)
 Det(correlation matrix)    0.2021
*/

/***********************************************************************************
*****	CREATING ESTIMATES FOR PREDICTED PROBABILITY PLOTS (FIGS 4 AND 5      ******
***********************************************************************************/

************************
***** 	PHASE 1 	****
************************

logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

margins, at(diversityplan=(0(10)100))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(navy%50))
plotopts(lpattern(dash) title("") lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 1 License)"))
scheme(plotplain) saving("pp_diversity1", replace)
;


logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

margins, at(ph1_partd=(100(50)550))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(navy%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 1 License)"))
scheme(plotplain) saving("pp_partd1", replace) 
;


logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

margins, at(ph1_parte=(0(25)150))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(navy%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 1 License)"))
scheme(plotplain) saving("pp_parte1", replace)
;


logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

margins, at(community=(0(10)100))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(navy%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 1 License)"))
scheme(plotplain) saving("pp_comm1", replace)
;


logit license1 diversityplan ph1_partd ph1_parte community siteplan , or 

margins, at(siteplan=(0(10)50))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(navy%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 1 License)"))
scheme(plotplain) saving("pp_site1", replace)
;

************************
***** 	PHASE 2 	****
************************

logit license2 diversityplan ph2_partd history community siteplan, or

margins, at(diversityplan=(0(10)100))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(red%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 2 License)"))
scheme(plotplain) saving("pp_diversity2", replace)
;


logit license2 diversityplan ph2_partd history community siteplan, or

margins, at(ph2_partd=(350(50)675))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(red%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 2 License)"))
scheme(plotplain) saving("pp_partd2", replace)
;


logit license2 diversityplan ph2_partd ph2_parte community siteplan, or

margins, at(ph2_parte=(0(15)75))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(red%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 2 License)"))
scheme(plotplain) saving("pp_parte2", replace)
;


logit license2 diversityplan ph2_partd ph2_parte community siteplan, or

margins, at(community=(0(10)100))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(red%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 2 License)"))
scheme(plotplain) saving("pp_comm2", replace)
;


logit license2 diversityplan ph2_partd ph2_parte community siteplan, or

margins, at(siteplan=(0(10)50))

#delimit ;
marginsplot, recastci(rarea) ciopt(color(red%50))
plotopts(lpattern(dash) lwidth(medium) msymbol(none) lcolor(black) ylabel(0(0.25)1) ytitle("Pr(Phase 2 License)"))
scheme(plotplain) saving("pp_site2", replace)
;

/******************************************************************************************************************
****  Figure 4: Predicted Probabilities of Winning Dispensary License based on Diversity and Community Plans  *****     
*******************************************************************************************************************/

gr combine pp_diversity1.gph pp_diversity2.gph pp_comm1.gph pp_comm2.gph, scheme(plotplain) col(2)

/******************************************************************************************************************
****  Figure 5: Predicted Probabilities of Winning Dispensary License based on Plan of Operation, 			  *****
Org Capacity, and Site Plan 																				  *****     
*******************************************************************************************************************/

gr combine pp_partd1.gph pp_partd2.gph pp_parte1.gph pp_parte2.gph pp_site1.gph pp_site2.gph, scheme(plotplain) col(2)
